import O1HD, {modules} from "../../engines/gameEngine";
import {REWARD_TYPE} from "../../engines/services/userContent/userInterface";
import data_control from "../../engines/libs/data_control";
import gameConfig from "../../engines/configs/gameConfig";

const {ccclass, property} = cc._decorator;

@ccclass
export default class coin extends cc.Component {

    @property(cc.Label)
    lbCoin: cc.Label = null;

    onLoad() {

    }

    start() {

    }

    OnBtnAddCoins() {
        modules().uiControlModule.showUserPropGet(REWARD_TYPE.COIN, gameConfig.ADD_ONCE_COINS);
    }

    update(dt) {
        this.lbCoin.string = data_control.getNumberFormat(O1HD.getServices().userSrv.getCoins(), 0);
    }
}
